package com.js.service;

import com.js.dao.UserDao;
import com.js.pojo.Category;
import com.js.pojo.News;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * author:JiangSong
 **/

@Service
public class UserServiceImpl implements UserService{
    @Resource
    private UserDao userDao;

    @Transactional
    public List<Category> findAllCategory() {
        return userDao.findAllCategory();
    }

    @Transactional
    public List<News> findAllNews() {
        return userDao.findAllNews();
    }

    @Transactional
    public List<News> allNewsByCid(int cid) {
        return userDao.allNewsByCid(cid);
    }

    @Transactional
    public News findNewsById(int id) {
        return userDao.findNewsById(id);
    }

    @Transactional
    public List<News> findNewsByTitle(String title) {
        return userDao.findNewsByTitle(title);
    }
}
